package com.servlet;


import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Regvrtycheck extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public Regvrtycheck() {
		super();
	}
	protected void service(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		String verity=(String)request.getParameter("verity");
		String vrty=(String)request.getSession().getAttribute("verify");
		if(verity.equalsIgnoreCase(vrty))
			verity="yes";
		else 
			verity="no";
		 response.reset();
		 response.setContentType("text/json");		
		 PrintWriter out = response.getWriter();
	     out.println("{\"verity\":\""+verity+"\"}");
		 out.flush();
	     out.close();
	}
}
